package com.lyz.dataStructure.xiancheng.多线程;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 14:44
 * @Description:
 **/

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/7/11 14:44
 *@Description:
 **/
public class ThreadDemo2 implements Runnable{


    @Override
    public void run() {
        for(int i=0;i<15;i++){
            System.out.println(Thread.currentThread().getName()+" "+i);
        }
    }

    public static void main(String[] args) {
        for(int i=0;i<20;i++){
            System.out.println(Thread.currentThread().getName()+" "+i);
            if(i==5){
                ThreadDemo2 td = new ThreadDemo2();
                new Thread(td,"新线程1").start();
                new Thread(td,"新线程2").start();
            }
        }

    }
}
